package com.kj.tms.common.bean.dto;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 服务器返回对象 所有服务器处理返回的统一对象
 */
public class ReturnData extends Throwable implements Serializable {
    private static final long serialVersionUID = -5190072370709772976L;
    // 返回代码
    private String code;
    // 返回信息
    private String msg;
    // 成功、失败标志
    private boolean successed = false;
    // 错误信息
    private List<String> errors = new ArrayList<String>();
    // 返回数据
    private Object returnObject;
    //返回错误码以及错误信息
    public ReturnData(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    //返回成功以及成功的数据
    public ReturnData(String code, Object returnObject) {
        this.code = code;
        this.returnObject = returnObject;
    }
    //返回状态码，信息，数据封装
    public ReturnData(String code, String msg,Object returnObject) {
        this.code = code;
        this.msg = msg;
        this.returnObject = returnObject;
    }



    public ReturnData() {
    }


    public boolean isSuccessed() {
        return successed;
    }

    public void setSuccessed(boolean successed) {
        this.successed = successed;
    }

    public List<String> getErrors() {
        return errors;
    }

    public void setErrors(List<String> errors) {
        this.errors = errors;
    }

    public Object getReturnObject() {
        return returnObject;
    }

    public void setReturnObject(Object returnObject) {
        this.returnObject = returnObject;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

}
